package com.lyrcsoft.application.service;

import com.lyrcsoft.spring.beans.annotation.Autowire;
import com.lyrcsoft.spring.beans.annotation.MyCustomValue;
import com.lyrcsoft.spring.beans.factory.BeanNameAware;
import com.lyrcsoft.spring.beans.factory.InitializingBean;
import com.lyrcsoft.spring.context.annotation.Scope;
import com.lyrcsoft.spring.stereotype.Component;

@Component("userService")
@Scope("singleton")
public class UserService implements InitializingBean, BeanNameAware {

	@Autowire
	private OrderService orderService;


	// 把自己声明的这个值，赋值给data字段
	@MyCustomValue("把自己声明的这个值，赋值给data字段")
	private String data;

	public void test() {

		System.out.println(data);
		System.out.println(orderService);
	}

	@Override
	public void afterPropertiesSet() {
		System.out.println("初始化");
	}

	@Override
	public void setBeanName(String beanName) {
		System.out.println("BeanNameAware:" + beanName);
	}
}
